<?php
class Bet8_3d
{

    public $table_name;
    public $db;

    public function Bet8_3d( $gametype = 1 )
    {
        global $g_gametype_3d;
        $this->table_name = "bet8_".$g_gametype_3d[$gametype]['en'];
        $this->db = new DB();
    }

    public function dbInsert( $fields )
    {
        $sql = "INSERT INTO {$this->table_name} (";
        $sql .= implode( ",", array_keys( $fields ) );
        $sql .= ") VALUES (";
        $sql .= implode( ",", array_values( $fields ) );
        $sql .= ")";
        if ( !$this->db->query( $sql ) )
        {
            return false;
        }
        return mysql_insert_id( $this->db->handle_master );
    }

}

?>